<%@ page contentType = "text/html;charset=utf-8" %>
<!DOCTYPE html>
<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<title>Henz Mobile</title>
<link rel="stylesheet" type="text/css" href="/css/index.css" />
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=<%=com.henz.web.variable.HenzApp.API_KEY%>"></script>
<script src="http://code.jquery.com/jquery-latest.min.js"></script>
<script src="/js/jquery.henzBind.js"></script>
<script src="/js/jquery.henz.ajax.js"></script>
<style>

</style>
<script>
$(document).ready(init);

var userObj = {
		 email:             'sixvern@nate.com'
		,FirstName:         'Younghoon'
		,MiddleInitial:     ''
		,LastName:          'Joe'
		,Gender:            'M'
		,Address:           'Address'
		,City:              'City'
		,Street:            'Street'
		,Zip:               'Zip'
		,Apartment:         'Apartment'
		,Insurance:         'Insurance'
		,InsuranceAccountNo:'InsuranceAccountNo'
		,OrganDonor:        'OrganDonor'
		,PhoneNum:          'PhoneNum'
	}

function init(){
	var saveData;
	saveData = {userList:new Array(userObj)};
	//saveData = [userObj];
	console.log( saveData );
	$.fn.hajax({
	    url: "/user/save.json",
		data: saveData,
		success : function(data, textStatus, jqXHR) {
			console.log('success....');
			console.log(data);
			console.log('success....');
		},
		error : function(jqXHR, textStatus, errorThrown) {
			console.log('error....');
			console.log(errorThrown);
			console.log('error....');
		}
	});
	/*
	$.fn.hajax({
	    url: "/user/save.json",
		data: JSON.stringify( saveData ),
		type: "POST",
		dataType: 'json',
		contentType: 'application/json',
		success : function(data, textStatus, jqXHR) {
			console.log('success....');
			console.log(data);
			console.log('success....');
		},
		error : function(jqXHR, textStatus, errorThrown) {
			console.log('error....');
			console.log(errorThrown);
			console.log('error....');
		}
	});
	*/
}


function search(){
	$.fn.hajax({
		url :"/user/list.json",
		data:{},
	  	success: function(data, textStatus, jqXHR){
			console.log( 'success....' );
			console.log( data );
			console.log('success....');
		},
		error : function(jqXHR, textStatus, errorThrown) {
			console.log('error....');
			console.log(errorThrown);
			console.log('error....');
		}
	});
	
}

</script>
</head>
<body>
<div class='titleArea'>
	search
	<a href='javascript:search();'>search</a>
</div>
<div class='dataArea'>
</div>

</body>
</html>

